<html><head><title>HTTPProgress</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">HTTPProgress()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>HTTPProgress</b></font>(HttpConnection)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Returns the progress of the specified asynchronous download, started either with <a href="receivehttpfile.html">ReceiveHTTPFile()</a> or 
<a href="receivehttpmemory.html">ReceiveHTTPMemory()</a>. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>HttpConnection</i></td>
<td width="90%"> 
The HTTP connection to monitor. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

The status of the download. It can be the current number of recieved bytes or one of the following value: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Http_Success</font>    : the download has been successfully finished.
  <font color="#924B72">#PB_Http_Failed</font>     : the download has failed.
  <font color="#924B72">#PB_Http_Aborted</font>    : the download has been aborted with <a href="aborthttp.html">AbortHTTP()</a>.
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">  InitNetwork</font>()

  Download =<font color="#3A3966"> ReceiveHTTPMemory</font>(&quot;http://www.purebasic.com/download/OgreAssimpConverter.zip&quot;, <font color="#924B72">#PB_HTTP_Asynchronous</font>)
  <b><font color="#3A3966">If</font></b> Download
    <b><font color="#3A3966">Repeat</font></b>
      Progress =<font color="#3A3966"> HTTPProgress</font>(Download)
      <b><font color="#3A3966">Select</font></b> Progress
        <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_Http_Success</font>
          *Buffer =<font color="#3A3966"> FinishHTTP</font>(Download)
          <b><font color="#3A3966">Debug</font></b> &quot;Download finished (size: &quot; +<font color="#3A3966"> MemorySize</font>(*Buffer) + &quot;)&quot;
<font color="#3A3966">          FreeMemory</font>(*Buffer)
          <b><font color="#3A3966">End</font></b>

        <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_Http_Failed</font>
          <b><font color="#3A3966">Debug</font></b> &quot;Download failed&quot;
          <b><font color="#3A3966">End</font></b>

        <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_Http_Aborted</font>
          <b><font color="#3A3966">Debug</font></b> &quot;Download aborted&quot;
          <b><font color="#3A3966">End</font></b>
          
        <b><font color="#3A3966">Default</font></b>
          <b><font color="#3A3966">Debug</font></b> &quot;Current download: &quot; + Progress
       
      <b><font color="#3A3966">EndSelect</font></b>
      
<font color="#3A3966">      Delay</font>(500) <font color="#3A3966">; Don't stole the whole CPU</font>
    <b><font color="#3A3966">ForEver</font></b>
  <b><font color="#3A3966">Else</font></b>
    <b><font color="#3A3966">Debug</font></b> &quot;Download error&quot;
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="receivehttpfile.html">ReceiveHTTPFile()</a>, <a href="receivehttpmemory.html">ReceiveHTTPMemory()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=geturlpart.html>GetURLPart()</a> - <a href="index.html">Http Index</a> - <a href="receivehttpfile.html">ReceiveHTTPFile()</a> -><br><br>

</body></html>